package com.yicong.ants.bean.home;

import com.chad.library.adapter.base.entity.MultiItemEntity;

/**
 * @author cchao
 * @version 2020-10-2
 */
public class ScenicItemWrapper<O> implements MultiItemEntity {
    Object Object;
    int mType;

    public ScenicItemWrapper() {
    }

    @Override
    public int getItemType() {
        if (Object instanceof NewsItem) {
            NewsItem item = (NewsItem) Object;
            return item.getItemType();
        }
        return mType;
    }

    public static ScenicItemWrapper of(int type, Object object) {
        ScenicItemWrapper bean = new ScenicItemWrapper();
        bean.setMType(type);
        bean.setObject(object);
        return bean;
    }

    public Object getObject() {
        return this.Object;
    }

    public int getMType() {
        return this.mType;
    }

    public void setObject(Object Object) {
        this.Object = Object;
    }

    public void setMType(int mType) {
        this.mType = mType;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof ScenicItemWrapper)) return false;
        final ScenicItemWrapper<?> other = (ScenicItemWrapper<?>) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$Object = this.getObject();
        final Object other$Object = other.getObject();
        if (this$Object == null ? other$Object != null : !this$Object.equals(other$Object))
            return false;
        if (this.getMType() != other.getMType()) return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof ScenicItemWrapper;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $Object = this.getObject();
        result = result * PRIME + ($Object == null ? 43 : $Object.hashCode());
        result = result * PRIME + this.getMType();
        return result;
    }

    public String toString() {
        return "ScenicItemWrapper(Object=" + this.getObject() + ", mType=" + this.getMType() + ")";
    }
}
